﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package net.wooga.pets.views {
    import flash.display.*;
    import net.wooga.pets.loading.vos.*;
    import net.wooga.pets.events.*;
    import net.wooga.pets.models.*;
    import net.wooga.pets.views.components.computerdisplay.*;
    import net.wooga.pets.constants.*;
    import org.robotlegs.mvcs.*;

    public class PetBoxMediator extends Mediator {

        public var petBox:PetBox;
        public var sessionModel:SessionModel;

        override public function onRegister():void{
            super.onRegister();
            this.loadAsset();
        }
        private function loadAsset():void{
            var _local1:String = ((this.petBox.petType.toLowerCase() + "_") + this.petBox.diseaseName.toLowerCase());
            var _local2:RequestEvent = new RequestEvent(EventConstants.SEND_REQUEST, this.onResult);
            _local2.addAssetRequest(ProtocolConstants.LOAD_COMPUTERDISPLAY, _local1);
            dispatch(_local2);
        }
        private function onResult(_arg1:ResultVO):void{
            if (_arg1.success){
                this.petBox.addPetAnimation((_arg1.data[ProtocolConstants.LOAD_COMPUTERDISPLAY] as MovieClip));
            };
        }

    }
}//package net.wooga.pets.views 
